// Author: wsfuyibing <682805@qq.com>
// Date: 2025-04-25

package kind

// OrderKind
// 订单类型.
type OrderKind int

const (
	OrderKindMember  OrderKind = 1 // 会员
	OrderKindSession OrderKind = 2 // 渔票
	OrderKindGoods   OrderKind = 3 // 商品
	OrderKindReward  OrderKind = 4 // 打赏
)

var (
	orderKindText = map[OrderKind]string{
		OrderKindMember:  "会员",
		OrderKindSession: "渔票",
		OrderKindGoods:   "商品",
		OrderKindReward:  "打赏",
	}
	orderKindPage = map[OrderKind]string{
		OrderKindMember:  "detail.user.profile", // 用户详情页
		OrderKindSession: "detail.session",      // 渔票详情页
		OrderKindGoods:   "detail.goods",        // 商品详情页
		OrderKindReward:  "basan.detail",        // 钓点详情页
	}
)

func (o OrderKind) IgnoreEmptyStock() bool { return o == OrderKindSession }

func (o OrderKind) IsSession() bool { return o == OrderKindSession }
func (o OrderKind) IsGoods() bool   { return o == OrderKindGoods }

func (o OrderKind) Page() string {
	if str, ok := orderKindPage[o]; ok {
		return str
	}
	return ""
}

func (o OrderKind) Text() string {
	if str, ok := orderKindText[o]; ok {
		return str
	}
	return ""
}
